<template>
<div class="use-magic-keys"></div>
</template>

<script setup lang="ts">
import { useMagicKeys } from "@vueuse/core";
import { watch } from "vue";

defineOptions({
  name: "UseMagicKeys"
})

const { shift, space, a, current } = useMagicKeys()
watch(space, v => {
  console.log('space键:', v)
})

watch(shift, v => {
  console.log('shift键:', v)
})

watch(a, v => {
  console.log('按下一个键:', v)
})
watch(current, current => {
  console.log('按下一个键:', current)
})
</script>
